package gmomo.test.gui;

import javax.swing.JOptionPane;

import gmomo.InvitationListener;
import gmomo.packet.Invitation;

public class GUIInvitationListener implements InvitationListener{
	
	private MainFrame main;
	
	public GUIInvitationListener(MainFrame main) {
		this.main = main;
	}

	public void invitationReceived(Invitation invitation) {
		StringBuffer buffer = new StringBuffer();
		buffer.append("From: " + invitation.getFrom()+"\n");
		buffer.append("Body: " + invitation.getBody()+"\n");
		buffer.append("Host: " + invitation.getHost()+"\n");
		buffer.append("Port: " + invitation.getPort()+"\n");
		System.out.println(buffer.toString());
		JOptionPane.showMessageDialog(main, buffer.toString(), "Invitation Rcved", JOptionPane.INFORMATION_MESSAGE);
	}

}
